{template 'common/header'}
{php echo $this -> set_tabbar($action, $storeid);}
<style>
    .item_box img{
        width: 100%;
        height: 100%;
    }
</style>
<script type="text/javascript">
    $(function(){
        $(':radio[name="email_enable"]').click(function(){
            if(this.checked) {
                if($(this).val() == '1') {
                    $('.email').show();
                } else {
                    $('.email').hide();
                }
            }
        });
    });
</script>
<div class="main">
	<form action="" method="post" class="form-horizontal form" enctype="multipart/form-data">
	<input type="hidden" name="id" value="{$setting['id']}" />
        <div class="panel panel-default">
            <div class="panel-heading">
                邮件设置
            </div>
            <div class="panel-body">
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">邮箱提醒</label>
                    <div class="col-sm-9">
                        <label for="email_enable" class="radio-inline"><input type="radio" name="email_enable" value="1" id="email_enable" {if $setting['email_enable']==1}checked{/if} /> 是</label>
                        &nbsp;&nbsp;&nbsp;
                        <label for="email_enable2" class="radio-inline"><input type="radio" name="email_enable" value="0" id="email_enable2"  {if $setting['email_enable']==0 || empty($setting)}checked{/if} /> 否</label>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">邮箱服务器</label>
                    <div class="col-sm-9">
                        <select name="email_host" class="form-control">
                            <option value="smtp.qq.com" {if $setting['email_host'] == 'smtp.qq.com' } selected="selected"{/if}>QQ邮箱</option>
                            <option value="smtp.126.com" {if $setting['email_host'] == 'smtp.126.com' } selected="selected"{/if}>126邮箱</option>
                            <option value="smtp.163.com" {if $setting['email_host'] == 'smtp.163.com' } selected="selected"{/if}>163邮箱</option>
                            <option value="smtp.sina.com" {if $setting['email_host'] == 'smtp.sina.com' } selected="selected"{/if}>sina邮箱</option>
                        </select>
                        <div class="help-block">QQ邮箱务必开启smtp服务</div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">发件人名称</label>
                    <div class="col-sm-9">
                        <input type="text" name="email_user" class="form-control" value="{if empty($setting['email_user']) || empty($setting)}微点餐{else}{$setting['email_user']}{/if}" />
                        <div class="help-block">指定发送邮件发信人名称</div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">发送帐号用户名</label>
                    <div class="col-sm-9">
                        <input type="text" name="email_send" class="form-control" value="{$setting['email_send']}" />
                        <div class="help-block">指定发送邮件的用户名，例如：123456@qq.com</div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">发送帐号密码</label>
                    <div class="col-sm-9">
                        <input type="password" name="email_pwd" class="form-control" value="{$setting['email_pwd']}" />
                        <div class="help-block">指定发送邮件的密码</div>
                    </div>
                </div>
                <div class="form-group">
                    <label class="col-xs-12 col-sm-3 col-md-2 control-label">提醒接收邮箱</label>
                    <div class="col-sm-9">
                        <input type="text" name="email" class="form-control" value="{$setting['email']}" />
                    </div>
                </div>
                <!--<div class="form-group">-->
                    <!--<label class="col-xs-12 col-sm-3 col-md-2 control-label">商户通知模板</label>-->
                    <!--<div class="col-sm-9">-->
                        <!--<textarea style="height:100px;" class="form-control" name="email_business_tpl" cols="70">{if empty($setting['email_business_tpl']) || empty($setting)}您有新的订单：【变量】，收货人：【变量】，电话：【变量】，请及时确认订单！{else}{$setting['email_business_tpl']}{/if}</textarea><br/>-->
                        <!--<p class="help-block span7">用于接受客户的订单消息，[sn]订单号，[name]客户名称,[date]时间，[goods]商品详情，[totalnum]总数量，[totalprice]总价格，[tel]电话，[address]地址，[remark]备注。-->
                        <!--</p>-->
                    <!--</div>-->
                <!--</div>-->
            </div>
        </div>
        <div class="form-group col-sm-12">
            <input name="submit" type="submit" value="保存设置" class="btn btn-primary span3">
            <input type="hidden" name="id" value="{$setting['id']}" />
            <input type="hidden" name="token" value="{$_W['token']}" />
        </div>
	</form>
</div>
{template 'common/footer'}